Skip to content

Conversation

Polygonalr
Copy link
Contributor

Can't believe I forgot about it until now 💀

@Polygonalr Polygonalr changed the title Implement compilation support for rest patterns in tuple structs Implement compilation support for rest patterns in tuple struct patterns Aug 26, 2025
@Polygonalr Polygonalr force-pushed the tuplestructitemshasrest-lowering branch from cf68642 to 8258d5c Compare September 2, 2025 13:56
@Polygonalr Polygonalr requested a review from philberty September 2, 2025 13:57
@Polygonalr Polygonalr force-pushed the tuplestructitemshasrest-lowering branch from 8258d5c to 1dbdc50 Compare September 8, 2025 09:18
@Polygonalr
Copy link
Contributor Author

@philberty Should be good to go now after rebasing to master to solve the Alpine Linux test failure.

gcc/rust/ChangeLog:

	* hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit(TupleStructPattern)):
	Implement lowering of AST::TupleStructItemsHasRest to HIR.
	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit(TupleStructPattern)):
	Add the respective type checking for AST::TupleStructItemsHasRest
	* checks/errors/rust-hir-pattern-analysis.cc (lower_tuple_pattern):
	Add respective pattern for HAS_REST case.

Signed-off-by: Yap Zhi Heng <[email protected]>
gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc: Add compilation support for TupleStructItemsHasRest
	in CompilePatternCheckExpr(TupleStructPattern) & CompilePatternBindings(TupleStructPattern)

Signed-off-by: Yap Zhi Heng <[email protected]>
gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (visit(TupleStructPattern)):
	Update error for mismatched number of fields to use rich_location.

Signed-off-by: Yap Zhi Heng <[email protected]>
@Polygonalr Polygonalr force-pushed the tuplestructitemshasrest-lowering branch from 1dbdc50 to 8779e12 Compare September 28, 2025 06:54
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added this pull request to the merge queue Oct 1, 2025
Merged via the queue into Rust-GCC:master with commit 7916adc Oct 1, 2025
13 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in libcore 1.49 Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants